package org.feifei.order.service;

import org.feifei.basic.service.BaseService;
import org.feifei.basic.util.PageList;
import org.feifei.order.domain.AdoptOrder;
import org.feifei.order.query.AdoptOrderQuery;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * 宠物领养的Service 层
 */
public interface AdoptOrderService extends BaseService<AdoptOrder> {
    /**
     * 生成宠物领养订单的方法
     * @param params
     * @param request
     * @return
     */
    String adoptOrderSubmit(Map<String, Object> params, HttpServletRequest request);

    /**
     * 管理员查看宠物领养订单
     * @param adoptOrderQuery
     * @param request
     * @return
     */
    PageList<AdoptOrder> adminAdoptOrder(AdoptOrderQuery adoptOrderQuery, HttpServletRequest request);

    /**
     * 用户查看宠物领养订单
     * @param adoptOrderQuery
     * @param request
     * @return
     */
    PageList<AdoptOrder> userAdoptOrder(AdoptOrderQuery adoptOrderQuery, HttpServletRequest request);

    /**
     * 如果用户支付超时，自动关闭订单，即修改订单的状态为-1
     * @param oid
     */
    void cancelOrder(long oid);
}
